package com.example.sso.service;

import com.example.sso.api.AuthClientAccountService;
import com.example.sso.api.AuthUserDetailsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;


/************ dubbo查询用户 ************/
@Slf4j
@Service
public class AuthUserDetailsServiceImpl implements AuthUserDetailsService {

    @Autowired
    private AuthClientAccountService authClientAccountService;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return authClientAccountService.loadUserByUsername(username);
    }
}
